home *** CD-ROM | disk | FTP | other *** search
- Notes on the Harvest C source code
-
- You must have THINK C 5.0x to compile Harvest C.
-
- The project file contains all the Harvest C source files, plus lots
- of TCL files (which you already have), plus several customized libraries.
- These libraries are named things like "ANSI 4 byte". Create these by
- copying the appropriate THINK C library, modifying the option settings
- to be exactly like those in the Harvest C project, and recompile.
-
- There are a number of files included here which are not currently used.
- Don't get real upset about this... For example, I don't think any
- of the DObject hierarchy is used. This was part of a C preprocessor I
- was writing for a class project, but did not finish.
-
- I didn't write all of the code included here. The Tool Command
- Language was written by John Ousterhout. Tim Endres and Pete Keleher
- and perhaps others even worked on the Mac port of same. The assembler
- routines were obtained from the Motorola BBS. The malloc library was
- written by Tim Endres.
-
- You may note that much of the code is hard to read, or not very well written.
- You're right. I wrote Harvest C as a learning experience. I constantly
- learned from my own mistakes. Some of those mistakes have already been
- corrected through rewrites. Some have not. Almost invariably, I am
- very aware of the deficiencies in this program and its design. The limiting
- factor which keeps me from fixing things is time, not [entirely] knowledge.
- The bottom line here is: I am making myself vulnerable by releasing code
- which I know is in many ways far from perfect. I will answer questions. I
- would prefer not to receive gripes or complaints.
-
- If you know a lot about compilers, it would probably not be a good idea
- to read the code in the parser, lexer, etc... I know better now.
-
- If you are just learning about compilers, read a compiler text. Your best
- learning experience w.r.t. Harvest C will be the ability to identify my
- mistakes. I knew very little when I wrote some of this -- I would do much of it
- differently now.
-
- Harvest C is badly hurting in terms of source file organization. Too many
- things get included in every file, and the layout of functions among files
- does not always make much sense.
-
- Harvest C was originally written on a Sun 3, using malloc() for dynamic memory
- allocation. I later ported to the Mac, and used NewHandle(). Anticipating
- this change, most struct references look like this
-
- Via(s)->member;
-
- instead of
-
- s->member;
-
- where Via() is a preprocessor macro which determines whether or not we are
- using malloc(). Current memory allocation uses malloc(), so Via expands
- to have no effect.
-
- You may be thinking about continuing to improve Harvest C and make it
- the greatest free C compiler around. I'd advise that you channel that
- enthusiasm into the efforts at porting GCC 2 to the Mac, based partially
- on Harvest C's code. This work is already in progress. Remember this:
-
- "I know Harvest C better than anyone (I wrote it). I estimate that the
- effort necessary for ME to make Harvest C a robust, awesome compiler would be
- far greater than the effort necessary to port GCC 2 and integrate the Harvest C
- linker and some other things. If you really want to see a great free C
- compiler for the Macintosh, direct your efforts toward GCC. Read the file
- called FUTURE for more info."
-
- Eric W. Sink
- 1014 Pomona Drive
- Champaign, IL 61821
- e-sink@uiuc.edu
-